package com.hellpro.lolbox.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

/**
 * Package_Name: com.hellpro.lolbox.db
 * Description :
 * author: HellPermanent
 * date:  2016/10/23 17:37
 * remarks：
 */
public class CollectDao {

    private final SQLiteDatabase mDb;

    public CollectDao(Context context){
        DBHelper helper = new DBHelper(context);
        mDb = helper.getWritableDatabase();
    }




    //获取数据库对象
    public  SQLiteDatabase getDb(){
        if (mDb!= null) {
            return mDb;
        }
        return  null;
    }

    //执行一个语句
    public  void execSql(String sql,String [] args){
        if (args!= null){
            mDb.execSQL(sql,args);
        }else {
            mDb.execSQL(sql);
        }
    }
}
